﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
             mc:Ignorable="d"
             x:Class="YourLastOptionsDialog.Views.EnumEditor"
             d:DesignWidth="480"
             d:DesignHeight="800">
    <UserControl.Resources>
        <DataTemplate x:Key="ListPickerItemTemplate">
            <Grid>
                <TextBlock Margin="0 0 0 10"
                           TextWrapping="Wrap"
                           d:LayoutOverrides="Width, Height"
                           Text="{Binding DisplayName}" />
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="ListPickerFullModeItemTemplate">
            <Grid>
                <TextBlock TextWrapping="Wrap"
                           Margin="{StaticResource PhoneTouchTargetLargeOverhang}"
                           Style="{StaticResource PhoneTextLargeStyle}"
                           Text="{Binding DisplayName}" />
            </Grid>
        </DataTemplate>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot"
          Background="Transparent"
          VerticalAlignment="Top"
          Margin="12,0,0,20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <StackPanel Orientation="Vertical"
                    VerticalAlignment="Top"
                    Margin="0,5,5,0">
            <TextBlock x:Name="DisplayNameTextBlock"
                       Margin="0"
                       TextWrapping="Wrap"
                       Text="{Binding DisplayName}"
                       Style="{StaticResource PhoneTextNormalStyle}" />
            <TextBlock x:Name="DescriptionTextBlock"
                       Margin="0"
                       TextWrapping="Wrap"
                       Text="{Binding Description}"
                       Style="{StaticResource PhoneTextNormalStyle}">
    			<TextBlock.Foreground>
    				<SolidColorBrush Color="{StaticResource PhoneDisabledColor}" />
    			</TextBlock.Foreground>
            </TextBlock>
        </StackPanel>

        <toolkit:ListPicker Margin="0"
                            d:LayoutOverrides="Height"
                            ExpansionMode="ExpansionAllowed"
                            SelectionMode="Single"
                            Grid.Row="1"
                            HorizontalAlignment="Stretch"
                            MinWidth="200"
                            ItemsSource="{Binding Lookup}"
                            SelectedItem="{Binding Value, Mode=TwoWay}"
                            ItemTemplate="{StaticResource ListPickerItemTemplate}"
                            FullModeHeader="{Binding DisplayName}"
                            FullModeItemTemplate="{StaticResource ListPickerFullModeItemTemplate}" />
    </Grid>
</UserControl>